﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Clothes.Model;
using Clothes.IBLL;
using Clothes.BLL;

namespace Clothes.UI
{
    public partial class WebForm1 : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                CLClassifyIBLL cLClassify = new CLClassifyBLL();
                List<CLClassify> list = cLClassify.select();
                DropDownList1.DataSource = list;
                DropDownList1.DataValueField = "Id";
                DropDownList1.DataTextField = "Category";
                DropDownList1.DataBind();
            }
               
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            CLDress cL = new CLDress()
            {
                Avatar = Session["aa"].ToString(),
                Summary = txt_jian.Text,
                TypeId =Convert.ToInt32( DropDownList1.SelectedValue),
                Surplus=Convert.ToInt32( txt_shu.Text),
                Price= Convert.ToInt32(txt_shou.Text),
                Money=Convert.ToInt32(txt_jing.Text),

            };
            CLDressIBLL cLDress = new CLDressBLL();
            var aa= cLDress.CLDressInsert(cL);
            if (aa) {
                Response.Redirect("About");
            }
            //var img= Session["aa"].ToString();
        }
    }
}